<extend name="Public/base"/>

<block name="style">
	<link rel="stylesheet" href="__STATIC__/plugins/data-tables/DT_bootstrap.css" />
</block>

<block name="body">
    
    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN EXAMPLE TABLE PORTLET-->
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="fa fa-globe"></i>[ {$data.title} ] 子</present>菜单管理</div>
                    <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                        <a href="#portlet-config" data-toggle="modal" class="config"></a>
                        <a href="javascript:;" class="reload"></a>
                    </div>
                </div>
                <div class="portlet-body">
                    <div class="table-toolbar">
                        <div class="btn-group">
                            <a class="btn green" href="{:U('add',array('pid'=>I('get.pid',0)))}">新 增</a>
                            <button class="btn green ajax-post confirm" url="{:U('del')}" target-form="ids">删 除</button>
                            <a class="btn green" href="{:U('import',array('pid'=>I('get.pid',0)))}">导 入</a>
                            <a class="btn green" href="{:U('sort',array('pid'=>I('get.pid',0)),'')}">排序</a>
                            <button class="btn green btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>  
                        </div>
                    </div>
                    <table class="table table-striped table-bordered table-hover" id="sample">
                        <thead>
                            <tr>
                                <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#sample .checkboxes" /></th>
                                <th>ID</th>
                                <th>名称</th>
                                <th>上级菜单</th>
                                <th>分组</th>
                                <th>URL</th>
                                <th>排序</th>
                                <th>仅开发者模式显示</th>
                                <th>隐藏</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <volist name="list" id="menu">
                                <tr class="odd gradeX">
                                    <td><input class="ids checkboxes" type="checkbox" name="id[]" value="{$menu.id}"></td>
                                    <td>{$menu.id}</td>
                                    <td>
                                        <a href="{:U('index?pid='.$menu['id'])}">{$menu.title}</a>
                                    </td>
                                    <td>{$menu.up_title|default='无'}</td>
                                    <td>{$menu.group}</td>
                                    <td>{$menu.url}</td>
                                    <td>{$menu.sort}</td>
                                    <td>
                                        <a href="{:U('toogleDev',array('id'=>$menu['id'],'value'=>abs($menu['is_dev']-1)))}" class="ajax-get">
                                        {$menu.is_dev_text}
                                        </a>
                                    </td>
                                    <td>
                                        <a href="{:U('toogleHide',array('id'=>$menu['id'],'value'=>abs($menu['hide']-1)))}" class="ajax-get">
                                        {$menu.hide_text}
                                        </a>
                                    </td>
                                    <td>
                                        <a title="编辑" href="{:U('edit?id='.$menu['id'])}">编辑</a>
                                        <a class="confirm ajax-get" title="删除" href="{:U('del?id='.$menu['id'])}">删除</a>
                                    </td>
                                </tr>
                            </volist>
                        </tbody>
                    </table>
                    
                    <!-- 分页 -->
                    <div class="page">
                        {$_page}
                    </div>
    
                </div>
            </div>
            <!-- END EXAMPLE TABLE PORTLET-->
        </div>
    </div>
</block>

<block name="script">
	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/jquery.dataTables.js"></script>
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/DT_bootstrap.js"></script>
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="__STATIC__/scripts/app.js"></script>
	<script src="__STATIC__/scripts/table-managed.js"></script>     
	<script>
		jQuery(document).ready(function() {       
		   App.init();
		   TableManaged.init();
		});
	</script>
</block>